/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package doan.quanlycanbo.portlet.service.persistence;

import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.service.ServiceContext;

import doan.quanlycanbo.portlet.model.dantoc;

import java.util.List;

/**
 * The persistence utility for the dantoc service. This utility wraps {@link dantocPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
 *
 * <p>
 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
 * </p>
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author Nguyen Tuan Vinh
 * @see dantocPersistence
 * @see dantocPersistenceImpl
 * @generated
 */
public class dantocUtil {
	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
	 */
	public static void clearCache() {
		getPersistence().clearCache();
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
	 */
	public static void clearCache(dantoc dantoc) {
		getPersistence().clearCache(dantoc);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
	 */
	public long countWithDynamicQuery(DynamicQuery dynamicQuery)
		throws SystemException {
		return getPersistence().countWithDynamicQuery(dynamicQuery);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
	 */
	public static List<dantoc> findWithDynamicQuery(DynamicQuery dynamicQuery)
		throws SystemException {
		return getPersistence().findWithDynamicQuery(dynamicQuery);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
	 */
	public static List<dantoc> findWithDynamicQuery(DynamicQuery dynamicQuery,
		int start, int end) throws SystemException {
		return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
	 */
	public static List<dantoc> findWithDynamicQuery(DynamicQuery dynamicQuery,
		int start, int end, OrderByComparator orderByComparator)
		throws SystemException {
		return getPersistence()
				   .findWithDynamicQuery(dynamicQuery, start, end,
			orderByComparator);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
	 */
	public static dantoc remove(dantoc dantoc) throws SystemException {
		return getPersistence().remove(dantoc);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
	 */
	public static dantoc update(dantoc dantoc, boolean merge)
		throws SystemException {
		return getPersistence().update(dantoc, merge);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
	 */
	public static dantoc update(dantoc dantoc, boolean merge,
		ServiceContext serviceContext) throws SystemException {
		return getPersistence().update(dantoc, merge, serviceContext);
	}

	/**
	* Caches the dantoc in the entity cache if it is enabled.
	*
	* @param dantoc the dantoc to cache
	*/
	public static void cacheResult(doan.quanlycanbo.portlet.model.dantoc dantoc) {
		getPersistence().cacheResult(dantoc);
	}

	/**
	* Caches the dantocs in the entity cache if it is enabled.
	*
	* @param dantocs the dantocs to cache
	*/
	public static void cacheResult(
		java.util.List<doan.quanlycanbo.portlet.model.dantoc> dantocs) {
		getPersistence().cacheResult(dantocs);
	}

	/**
	* Creates a new dantoc with the primary key. Does not add the dantoc to the database.
	*
	* @param madantoc the primary key for the new dantoc
	* @return the new dantoc
	*/
	public static doan.quanlycanbo.portlet.model.dantoc create(long madantoc) {
		return getPersistence().create(madantoc);
	}

	/**
	* Removes the dantoc with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param madantoc the primary key of the dantoc to remove
	* @return the dantoc that was removed
	* @throws doan.quanlycanbo.portlet.NoSuchdantocException if a dantoc with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.dantoc remove(long madantoc)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdantocException {
		return getPersistence().remove(madantoc);
	}

	public static doan.quanlycanbo.portlet.model.dantoc updateImpl(
		doan.quanlycanbo.portlet.model.dantoc dantoc, boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().updateImpl(dantoc, merge);
	}

	/**
	* Finds the dantoc with the primary key or throws a {@link doan.quanlycanbo.portlet.NoSuchdantocException} if it could not be found.
	*
	* @param madantoc the primary key of the dantoc to find
	* @return the dantoc
	* @throws doan.quanlycanbo.portlet.NoSuchdantocException if a dantoc with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.dantoc findByPrimaryKey(
		long madantoc)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdantocException {
		return getPersistence().findByPrimaryKey(madantoc);
	}

	/**
	* Finds the dantoc with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param madantoc the primary key of the dantoc to find
	* @return the dantoc, or <code>null</code> if a dantoc with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.dantoc fetchByPrimaryKey(
		long madantoc)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByPrimaryKey(madantoc);
	}

	/**
	* Finds all the dantocs where groupId = &#63; and languageId = &#63;.
	*
	* @param groupId the group id to search with
	* @param languageId the language id to search with
	* @return the matching dantocs
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.dantoc> findByG_L(
		long groupId, java.lang.String languageId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByG_L(groupId, languageId);
	}

	/**
	* Finds a range of all the dantocs where groupId = &#63; and languageId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param groupId the group id to search with
	* @param languageId the language id to search with
	* @param start the lower bound of the range of dantocs to return
	* @param end the upper bound of the range of dantocs to return (not inclusive)
	* @return the range of matching dantocs
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.dantoc> findByG_L(
		long groupId, java.lang.String languageId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByG_L(groupId, languageId, start, end);
	}

	/**
	* Finds an ordered range of all the dantocs where groupId = &#63; and languageId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param groupId the group id to search with
	* @param languageId the language id to search with
	* @param start the lower bound of the range of dantocs to return
	* @param end the upper bound of the range of dantocs to return (not inclusive)
	* @param orderByComparator the comparator to order the results by
	* @return the ordered range of matching dantocs
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.dantoc> findByG_L(
		long groupId, java.lang.String languageId, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findByG_L(groupId, languageId, start, end, orderByComparator);
	}

	/**
	* Finds the first dantoc in the ordered set where groupId = &#63; and languageId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param groupId the group id to search with
	* @param languageId the language id to search with
	* @param orderByComparator the comparator to order the set by
	* @return the first matching dantoc
	* @throws doan.quanlycanbo.portlet.NoSuchdantocException if a matching dantoc could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.dantoc findByG_L_First(
		long groupId, java.lang.String languageId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdantocException {
		return getPersistence()
				   .findByG_L_First(groupId, languageId, orderByComparator);
	}

	/**
	* Finds the last dantoc in the ordered set where groupId = &#63; and languageId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param groupId the group id to search with
	* @param languageId the language id to search with
	* @param orderByComparator the comparator to order the set by
	* @return the last matching dantoc
	* @throws doan.quanlycanbo.portlet.NoSuchdantocException if a matching dantoc could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.dantoc findByG_L_Last(
		long groupId, java.lang.String languageId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdantocException {
		return getPersistence()
				   .findByG_L_Last(groupId, languageId, orderByComparator);
	}

	/**
	* Finds the dantocs before and after the current dantoc in the ordered set where groupId = &#63; and languageId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param madantoc the primary key of the current dantoc
	* @param groupId the group id to search with
	* @param languageId the language id to search with
	* @param orderByComparator the comparator to order the set by
	* @return the previous, current, and next dantoc
	* @throws doan.quanlycanbo.portlet.NoSuchdantocException if a dantoc with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.dantoc[] findByG_L_PrevAndNext(
		long madantoc, long groupId, java.lang.String languageId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdantocException {
		return getPersistence()
				   .findByG_L_PrevAndNext(madantoc, groupId, languageId,
			orderByComparator);
	}

	/**
	* Finds all the dantocs.
	*
	* @return the dantocs
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.dantoc> findAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll();
	}

	/**
	* Finds a range of all the dantocs.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of dantocs to return
	* @param end the upper bound of the range of dantocs to return (not inclusive)
	* @return the range of dantocs
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.dantoc> findAll(
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll(start, end);
	}

	/**
	* Finds an ordered range of all the dantocs.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of dantocs to return
	* @param end the upper bound of the range of dantocs to return (not inclusive)
	* @param orderByComparator the comparator to order the results by
	* @return the ordered range of dantocs
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.dantoc> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll(start, end, orderByComparator);
	}

	/**
	* Removes all the dantocs where groupId = &#63; and languageId = &#63; from the database.
	*
	* @param groupId the group id to search with
	* @param languageId the language id to search with
	* @throws SystemException if a system exception occurred
	*/
	public static void removeByG_L(long groupId, java.lang.String languageId)
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeByG_L(groupId, languageId);
	}

	/**
	* Removes all the dantocs from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public static void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeAll();
	}

	/**
	* Counts all the dantocs where groupId = &#63; and languageId = &#63;.
	*
	* @param groupId the group id to search with
	* @param languageId the language id to search with
	* @return the number of matching dantocs
	* @throws SystemException if a system exception occurred
	*/
	public static int countByG_L(long groupId, java.lang.String languageId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countByG_L(groupId, languageId);
	}

	/**
	* Counts all the dantocs.
	*
	* @return the number of dantocs
	* @throws SystemException if a system exception occurred
	*/
	public static int countAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countAll();
	}

	public static dantocPersistence getPersistence() {
		if (_persistence == null) {
			_persistence = (dantocPersistence)PortletBeanLocatorUtil.locate(doan.quanlycanbo.portlet.service.ClpSerializer.SERVLET_CONTEXT_NAME,
					dantocPersistence.class.getName());
		}

		return _persistence;
	}

	public void setPersistence(dantocPersistence persistence) {
		_persistence = persistence;
	}

	private static dantocPersistence _persistence;
}